package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.News;
import cn.wolfcode.trip.base.query.NewsQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface NewsMapper {
    int deleteByPrimaryKey(Long id);

    int insert(News record);

    News selectByPrimaryKey(Long id);

    List<News> selectAll();

    int updateByPrimaryKey(News record);

    List<News> selectForList(NewsQueryObject qo);

    int selectMaxSequence();

    void updateBroseNumById(@Param("id") Long id, @Param("browseNum") Integer browseNum);

    void updateLikeNumById(@Param("id") Long id, @Param("likeNum") Integer likeNum);

    News selectNewsByUserId(@Param("userId") Long userId, @Param("newsId") Long newsId);

    void insertUserAndCollectionRelation(@Param("newsId") Long newsId, @Param("userId") Long userId);

    void updateCollectionNumById(@Param("id") Long id, @Param("collectionNum") Integer collectionNum);

    void deleteCollectionAndUserRelation(@Param("newsId") Long newsId, @Param("userId") Long userId);
}